package com.xuyuan.cloud.nacos;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
public class NacosConfigExample implements EnvironmentAware {

    private static final Logger logger = LoggerFactory.getLogger(NacosConfigExample.class);

    @Override
    public void setEnvironment(Environment environment) {
        ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment;
        logger.info(String.valueOf(configurableEnvironment.getPropertySources()));
    }
}
